<?php
require_once 'header.php';
require_once 'backend/Cart.php';
require_once 'backend/Item.php';
$item = new Item();
?>
	<div id = "pagecontent">
	  <fieldset>
	  <legend>Appetizers</legend>
	  <?php 
	 	$result = $item->getAppetizers();
	  	while($row = mysql_fetch_array($result))
	  	{
	  		$itemid = $row['no'];
	  		echo "<b>" . $row['name'] . "....$" . $row['price'] . "</b><br>";
	  		echo $row['description'];
	  		echo "<br><br>";
	  		echo "<form action='Menu.php' method='post'>";
	  		if(isset($_POST['appy']))
			{
				$id = $_POST['appy'];
				if($id == $itemid)
				{
					$cart->addItemToCart($itemid);
					echo "<script language='JavaScript'>window.location.href='Menu.php'</script>";
				}
	
			}
			
			echo "<input type='hidden' name='appy' value='$itemid'/>";
			echo "<input type='submit' name='Add to Cart' value='Add to Cart'/></form><br><br>";
	  	}
	  
	  ?>
	  
	  </fieldset>
	  
	  
	  <fieldset>
	  <legend>Soups</legend>
	  <?php 
	  
	 	$result = $item->getSoups();
	  	while($row = mysql_fetch_array($result))
	  	{
	  		$itemid = $row['no'];
	  		echo "<b>" . $row['name'] . "....$" . $row['price'] . "</b><br>";
	  		echo $row['description'];
	  		echo "<br><br>";
	  		echo "<form action='Menu.php' method='post'>";
	  		if(isset($_POST['soup']))
			{
				$id = $_POST['soup'];
				if($id == $itemid)
				{
					$cart->addItemToCart($itemid);
					echo "<script language='JavaScript'>window.location.href='Menu.php'</script>";
				}
	
			}
			
			echo "<input type='hidden' name='soup' value='$itemid'/>";
			echo "<input type='submit' name='Add to Cart' value='Add to Cart'/></form><br><br>";
	  	}
	  
	  ?>
	  
	  </fieldset>
	  
	  
	  <fieldset>
	  <legend>Salads</legend>
	  <?php 
	  
	 	$result = $item->getSalads();
	  	while($row = mysql_fetch_array($result))
	  	{
	  		$itemid = $row['no'];
	  		echo "<b>" . $row['name'] . "....$" . $row['price'] . "</b><br>";
	  		echo $row['description'];
	  		echo "<br><br>";
	  		echo "<form action='Menu.php' method='post'>";
	  		if(isset($_POST['salad']))
			{
				$id = $_POST['salad'];
				if($id == $itemid)
				{
					$cart->addItemToCart($itemid);
					echo "<script language='JavaScript'>window.location.href='Menu.php'</script>";
				}
	
			}
			
			echo "<input type='hidden' name='salad' value='$itemid'/>";
			echo "<input type='submit' name='Add to Cart' value='Add to Cart'/></form><br><br>";
	  	}
	  
	  ?>
	  
	  </fieldset>
	
	</div>


<?php require_once 'footer.php';?>